package com.huwaiwai.map;

import com.google.common.collect.Lists;

import java.util.Arrays;
import java.util.List;

/**
 * Created by hww on 2018/1/15 下午11:37.
 */
public class Test {
    public static void main(String [] arg) {
        test2();
    }

    public static void test2() {
        MyLinkedHashMap map = new MyLinkedHashMap();
        for (int i = 0; i < 5; i++) {
            map.put("" + i, i);
        }
        map.forEach((k, v) -> System.out.println("k=" + k + " v=" + v));
        System.out.println("--------");
        map.get("0");
        map.put("5", 5);
        map.forEach((k, v) -> System.out.println("k=" + k + " v=" + v));
    }

    public static String test(int size, int codeCount) {
        int rate = size * 10000 / codeCount;
        return rate / 100 + "." + rate % 100 + "%";
    }

    public static void test1() {
        List<Integer> list = Lists.newArrayList(1,2,3,4,5);

        Object[] a = list.toArray();
        list.add(6);

        System.out.println(Arrays.toString(a));

    }






}
